package com.itheima.web.controller;

import com.itheima.web.manager.AnalysisManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AnalysisController {


    @Autowired
    private AnalysisManager analysisManager;

    // 统计展示
    @GetMapping("/dashboard/summary")
    public ResponseEntity summary(){
        return analysisManager.summary();
    }

    //新增、活跃用户、次日留存率图片展示
    @GetMapping("/dashboard/users")
    public ResponseEntity users(@RequestParam(value = "sd") String startTime, @RequestParam(value = "ed") String endTime,String type){

        return analysisManager.users(startTime,endTime,type);
    }


}
